package Test;

import Test.Student;

public class 第三题 implements Comparable<第三题> {

    private String stuName ;
    private Integer stuId;
    private Integer stuCj;

    public 第三题(int i) {

        String str = "";
        this.stuName = str;

        String[] firstName = { "张", "王", "李", "赵", "吴", "刘", "孙" };
        String[] lastName = { "三", "楠", "娜", "伟", "芳", "建国", "秀英", "敏", "军", "涛", "超", "杰" };

        this.stuName = firstName[(int) (Math.random() * firstName.length)]
                + lastName[(int) (Math.random() * lastName.length)];

        this.stuCj = (int)(Math.random()*40+60);
        this.stuId=i;

    }

    public Integer getStuId() {
        return stuId;
    }

    public void setStuId(Integer stuId) {
        this.stuId = stuId;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public Integer getStuCj() {
        return stuCj;
    }

    public void setStuCj(Integer stuCj) {
        this.stuCj = stuCj;
    }
    @Override
    public String toString() {
        return "第三题 [stuName=" + stuName + ", stuId=" + stuId + ", stuCj=" + stuCj + "]";
    }

    @Override
    public int compareTo(第三题 o) {
        int result=0;
        int zg=o.getStuCj();
        int me=this.stuCj;
        if(me==zg) {
            result=this.stuCj-o.stuCj;
        }else {
            result=this.stuCj-o.stuCj;
        }
        return result;
    }
}